<form action='<{$thisUrl}>&action=to_import' method='post' target="uploadframe" enctype="multipart/form-data" id="import_form" class="tableform">
<h4><{t}>上传.CSV文件<{/t}></h4>
<div class="division" >
<input type='file' name='import_file' id='ImportCSV'/>
</div>
<div class="table-action">
<{button label=$___desktop="导入"|t:'desktop' id="ImportBtn" disabled="disabled" type="submit"}>
</div>
</form>
<script>
(function(){
	$('import_form').addEvent('submit',function(e){
		if(!$('ImportCSV').value.length) return false;
		$('ImportBtn').set('disabled',true);
	});
	$('ImportCSV').addEvent('change',function(e){
        if(!/\.csv$/.test(this.get('value').toLowerCase())){
            this.set('value','');
            return MessageBox.error('<{t}>只能上传.csv文件！<{/t}>');
        }
        $('ImportBtn').set('disabled',false);
    });
})();
</script>
